﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Model
{
    /// <summary>
    /// RESPONSABILITY: -data bucket
    ///                 
    /// </summary>
    public class Task:ITask
    {
        public string TaskCode { get; set; }
        public int EstimatedTime { get; set; }
        public Employee AssignedEmployee{get;set;}
        IDGenerator idGenerator = IDGenerator.Instance;

        public int TaskId { get; private set; }
        static private List<int> tasksIds{get;set;}
        

        private int TaskId_Generator()
        {
            Type type = typeof(Task);
            return idGenerator.RandomIDGenerator(type) ;
        }

        public Task(string taskCode, int estimatedTime, Employee _employee)
        {
            this.TaskCode = taskCode;
            this.EstimatedTime = estimatedTime;
            this.AssignedEmployee = _employee;
            tasksIds = new List<int>();
            
           
            TaskId = TaskId_Generator();
            tasksIds.Add(TaskId);
        }

        public double EstimateCost()
        {
            return (this.EstimatedTime * this.AssignedEmployee.Wage);
        }
    }
}
